<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>bn::rect class | Butano Docs</title>
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
  <link rel="icon" href="favicon-dark.png" type="image/png" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="theme-color" content="#22272e" />
</head>
<body>
<header><nav id="navigation">
  <div class="m-container">
    <div class="m-row">
      <span id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">
        <a href="https://github.com/GValiente/butano">Butano</a> <span class="m-breadcrumb">|</span> <a href="index.html" class="m-thin">Docs</a>
      </span>
      <div class="m-col-t-4 m-hide-m m-text-right m-nopadr">
        <a href="#search" class="m-doc-search-icon" title="Search" onclick="return showSearch()"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
          <path id="m-doc-search-icon-path" d="m6 0c-3.31 0-6 2.69-6 6 0 3.31 2.69 6 6 6 1.49 0 2.85-0.541 3.89-1.44-0.0164 0.338 0.147 0.759 0.5 1.15l3.22 3.79c0.552 0.614 1.45 0.665 2 0.115 0.55-0.55 0.499-1.45-0.115-2l-3.79-3.22c-0.392-0.353-0.812-0.515-1.15-0.5 0.895-1.05 1.44-2.41 1.44-3.89 0-3.31-2.69-6-6-6zm0 1.56a4.44 4.44 0 0 1 4.44 4.44 4.44 4.44 0 0 1-4.44 4.44 4.44 4.44 0 0 1-4.44-4.44 4.44 4.44 0 0 1 4.44-4.44z"/>
        </svg></a>
        <a id="m-navbar-show" href="#navigation" title="Show navigation"></a>
        <a id="m-navbar-hide" href="#" title="Hide navigation"></a>
      </div>
      <div id="m-navbar-collapse" class="m-col-t-12 m-show-m m-col-m-none m-right-m">
        <div class="m-row">
          <ol class="m-col-t-6 m-col-m-none">
            <li><a href="pages.html">Pages</a></li>
            <li><a href="modules.html">Modules</a></li>
          </ol>
          <ol class="m-col-t-6 m-col-m-none" start="3">
            <li><a href="namespaces.html">Namespaces</a></li>
            <li><a href="annotated.html">Classes</a></li>
            <li><a href="files.html">Files</a></li>
            <li class="m-show-m"><a href="#search" class="m-doc-search-icon" title="Search" onclick="return showSearch()"><svg style="height: 0.9rem;" viewBox="0 0 16 16">
              <use href="#m-doc-search-icon-path" />
            </svg></a></li>
          </ol>
        </div>
      </div>
    </div>
  </div>
</nav></header>
<main><article>
  <div class="m-container m-container-inflatable">
    <div class="m-row">
      <div class="m-col-l-10 m-push-l-1">
        <h1>
          <span class="m-breadcrumb"><a href="namespacebn.html">bn</a>::<wbr/></span>rect <span class="m-thin">class</span>
          <div class="m-doc-include m-code m-inverted m-text-right"><span class="cp">#include</span> <a class="cpf" href="bn__rect_8h.html">&lt;bn_rect.h&gt;</a></div>
        </h1>
        <p>Defines a two-dimensional rectangle using integer precision and a center point as position.</p>
        <nav class="m-block m-default">
          <h3>Contents</h3>
          <ul>
            <li>
              Reference
              <ul>
                <li><a href="#typeless-methods">Constructors, destructors, conversion operators</a></li>
                <li><a href="#pub-methods">Public functions</a></li>
                <li><a href="#friends">Friends</a></li>
              </ul>
            </li>
          </ul>
        </nav>
<p>Since it takes a center point as position instead of a top-left point, it has problems with odd dimensions.</p><p>If you need to handle odd dimensions, use <a href="classbn_1_1top__left__rect.html" class="m-doc">bn::<wbr />top_left_rect</a> instead.</p>
        <section id="typeless-methods">
          <h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
          <dl class="m-doc">
            <dt id="a60cfeac9452e6bdf72bf45b46c3c84f1">
              <span class="m-doc-wrap-bumper"><a href="#a60cfeac9452e6bdf72bf45b46c3c84f1" class="m-doc-self">rect</a>(</span><span class="m-doc-wrap">) <span class="m-label m-flat m-info">defaulted</span> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Default constructor.</dd>
            <dt>
              <span class="m-doc-wrap-bumper"><a href="#ad782d984ec680a56ec58e8674bae7f91" class="m-doc">rect</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; position,
              const <a href="classbn_1_1size.html" class="m-doc">size</a>&amp; dimensions) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Constructor.</dd>
            <dt>
              <span class="m-doc-wrap-bumper"><a href="#af0c7ad8b0005b079771eea22de759f12" class="m-doc">rect</a>(</span><span class="m-doc-wrap">int x,
              int y,
              int width,
              int height) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Constructor.</dd>
          </dl>
        </section>
        <section id="pub-methods">
          <h2><a href="#pub-methods">Public functions</a></h2>
          <dl class="m-doc">
            <dt id="aba1beca18526397d03bced655633a578">
              <span class="m-doc-wrap-bumper">auto <a href="#aba1beca18526397d03bced655633a578" class="m-doc-self">position</a>(</span><span class="m-doc-wrap">) const -&gt; const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the center point of the rectangle.</dd>
            <dt id="a38afdae9c0588db5513dd1c47fffb1bc">
              <span class="m-doc-wrap-bumper">void <a href="#a38afdae9c0588db5513dd1c47fffb1bc" class="m-doc-self">set_position</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; position) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the position of the center point of the rectangle.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">void <a href="#a37bc38d06f075632ed4e468748f11308" class="m-doc">set_position</a>(</span><span class="m-doc-wrap">int x,
              int y) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the position of the center point of the rectangle.</dd>
            <dt id="a61d9a2c04ebc656301ccee9b2ed37030">
              <span class="m-doc-wrap-bumper">auto <a href="#a61d9a2c04ebc656301ccee9b2ed37030" class="m-doc-self">dimensions</a>(</span><span class="m-doc-wrap">) const -&gt; const <a href="classbn_1_1size.html" class="m-doc">size</a>&amp; <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the size of the rectangle.</dd>
            <dt id="a926aa2dfea23d2058ac00f256b918931">
              <span class="m-doc-wrap-bumper">void <a href="#a926aa2dfea23d2058ac00f256b918931" class="m-doc-self">set_dimensions</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1size.html" class="m-doc">size</a>&amp; dimensions) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the size of the rectangle.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">void <a href="#a448fa647197b081035dc2bebe4f9661e" class="m-doc">set_dimensions</a>(</span><span class="m-doc-wrap">int width,
              int height) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the size of the rectangle.</dd>
            <dt id="a9e20267946cc1c1ef03b72b5c77e8305">
              <span class="m-doc-wrap-bumper">auto <a href="#a9e20267946cc1c1ef03b72b5c77e8305" class="m-doc-self">x</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the horizontal position of the center point of the rectangle.</dd>
            <dt id="a783118c955f05192a6f159d951a842f8">
              <span class="m-doc-wrap-bumper">void <a href="#a783118c955f05192a6f159d951a842f8" class="m-doc-self">set_x</a>(</span><span class="m-doc-wrap">int x) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the horizontal position of the center point of the rectangle.</dd>
            <dt id="a88859c778d5704c99280c82bd309d307">
              <span class="m-doc-wrap-bumper">auto <a href="#a88859c778d5704c99280c82bd309d307" class="m-doc-self">y</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the vertical position of the center point of the rectangle.</dd>
            <dt id="a53ed7b1633f1e766a2ba2cb23266702a">
              <span class="m-doc-wrap-bumper">void <a href="#a53ed7b1633f1e766a2ba2cb23266702a" class="m-doc-self">set_y</a>(</span><span class="m-doc-wrap">int y) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the vertical position of the center point of the rectangle.</dd>
            <dt id="a0f20ff2c39e006c56323c7fb019fb09b">
              <span class="m-doc-wrap-bumper">auto <a href="#a0f20ff2c39e006c56323c7fb019fb09b" class="m-doc-self">width</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the width of the rectangle.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">void <a href="#af81766d35c3be21f02608fecb70976dc" class="m-doc">set_width</a>(</span><span class="m-doc-wrap">int width) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the width of the rectangle.</dd>
            <dt id="abf52c02d712f548b0a9469a73abc4dd2">
              <span class="m-doc-wrap-bumper">auto <a href="#abf52c02d712f548b0a9469a73abc4dd2" class="m-doc-self">height</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the height of the rectangle.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">void <a href="#a8b21df7856dbbd3a3c38c0ad48fbd466" class="m-doc">set_height</a>(</span><span class="m-doc-wrap">int height) <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Sets the height of the rectangle.</dd>
            <dt id="a474ce5b1406ed778dd41d66921a84ea1">
              <span class="m-doc-wrap-bumper">auto <a href="#a474ce5b1406ed778dd41d66921a84ea1" class="m-doc-self">top</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the top boundary of the rectangle.</dd>
            <dt id="a56a618fc051c385a78c713f36dc948ef">
              <span class="m-doc-wrap-bumper">auto <a href="#a56a618fc051c385a78c713f36dc948ef" class="m-doc-self">left</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the left boundary of the rectangle.</dd>
            <dt id="ab2ff9202ade4c681df3a9d324b393b02">
              <span class="m-doc-wrap-bumper">auto <a href="#ab2ff9202ade4c681df3a9d324b393b02" class="m-doc-self">bottom</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the bottom boundary of the rectangle.</dd>
            <dt id="ae5ee254d127b3f58d953ce0e3af6d6ab">
              <span class="m-doc-wrap-bumper">auto <a href="#ae5ee254d127b3f58d953ce0e3af6d6ab" class="m-doc-self">right</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the right boundary of the rectangle.</dd>
            <dt id="a4289696a8583d2136f8ad3393ea9c5b7">
              <span class="m-doc-wrap-bumper">auto <a href="#a4289696a8583d2136f8ad3393ea9c5b7" class="m-doc-self">top_left</a>(</span><span class="m-doc-wrap">) const -&gt; <a href="classbn_1_1point.html" class="m-doc">point</a> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the top-left corner of the rectangle.</dd>
            <dt id="ac75c661faa47504dc7ce33e9b1808ac1">
              <span class="m-doc-wrap-bumper">auto <a href="#ac75c661faa47504dc7ce33e9b1808ac1" class="m-doc-self">top_right</a>(</span><span class="m-doc-wrap">) const -&gt; <a href="classbn_1_1point.html" class="m-doc">point</a> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the top-right corner of the rectangle.</dd>
            <dt id="ab4b28ee6be227e318c9f5277152364ad">
              <span class="m-doc-wrap-bumper">auto <a href="#ab4b28ee6be227e318c9f5277152364ad" class="m-doc-self">bottom_left</a>(</span><span class="m-doc-wrap">) const -&gt; <a href="classbn_1_1point.html" class="m-doc">point</a> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the bottom-left corner of the rectangle.</dd>
            <dt id="a3f79985f354f01bc15ed35339f3f510f">
              <span class="m-doc-wrap-bumper">auto <a href="#a3f79985f354f01bc15ed35339f3f510f" class="m-doc-self">bottom_right</a>(</span><span class="m-doc-wrap">) const -&gt; <a href="classbn_1_1point.html" class="m-doc">point</a> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the bottom-right corner of the rectangle.</dd>
            <dt id="a3e8d26df2848c382d71dd391ca63f9ae">
              <span class="m-doc-wrap-bumper">auto <a href="#a3e8d26df2848c382d71dd391ca63f9ae" class="m-doc-self">center_x</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the horizontal position of the center point of the rectangle.</dd>
            <dt id="aacb67665559df255222207926b861028">
              <span class="m-doc-wrap-bumper">auto <a href="#aacb67665559df255222207926b861028" class="m-doc-self">center_y</a>(</span><span class="m-doc-wrap">) const -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the vertical position of the center point of the rectangle.</dd>
            <dt id="a84578c691a403813c8826b4a3d6760f9">
              <span class="m-doc-wrap-bumper">auto <a href="#a84578c691a403813c8826b4a3d6760f9" class="m-doc-self">center</a>(</span><span class="m-doc-wrap">) const -&gt; <a href="classbn_1_1point.html" class="m-doc">point</a> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns the position of the center point of the rectangle.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#a5d4d32802fc63a93b8c85c01800a52d1" class="m-doc">contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; point) const -&gt; bool <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Indicates if the given point is inside the rectangle or not.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#aac8db2d139d5bef452d014cd3c6321bb" class="m-doc">edge_contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; point) const -&gt; bool <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Indicates if the given point is inside the rectangle or not.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#a9ac43cbf65f781c62411657377a162bd" class="m-doc">contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const -&gt; bool <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Indicates if the given rectangle is inside this one or not.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#a489c30bd04e3d342ccb29463f84b5359" class="m-doc">edge_contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const -&gt; bool <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Indicates if the given rectangle is inside this one or not.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#af9f9b9e6644f1736f30275433430791f" class="m-doc">intersects</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const -&gt; bool <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Indicates if this rectangle intersects with the given one or not.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#a831de875831919a34bccec21f38ac239" class="m-doc">touches</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const -&gt; bool <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Indicates if this rectangle touches the given one or not.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#ab47aaef239cc4426f741b6f481df20eb" class="m-doc">operator*=</a>(</span><span class="m-doc-wrap">int value) -&gt; <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Multiplies both width and height of the rectangle by the given factor.</dd>
            <dt>
              <span class="m-doc-wrap-bumper">auto <a href="#a903c50e94d412752a496c9e88dbc8b3c" class="m-doc">operator/=</a>(</span><span class="m-doc-wrap">int value) -&gt; <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Divides both width and height of the rectangle by the given divisor.</dd>
          </dl>
        </section>
        <section id="friends">
          <h2><a href="#friends">Friends</a></h2>
          <dl class="m-doc">
            <dt id="ab585a9ba9ed425020cd815ece7c3b848">
              <span class="m-doc-wrap-bumper">auto <a href="#ab585a9ba9ed425020cd815ece7c3b848" class="m-doc-self">operator*</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; a,
              int b) -&gt; <a href="classbn_1_1rect.html" class="m-doc">rect</a> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns a multiplied by b.</dd>
            <dt id="a6497807855cfa8e0042914ae8ae319ab">
              <span class="m-doc-wrap-bumper">auto <a href="#a6497807855cfa8e0042914ae8ae319ab" class="m-doc-self">operator/</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; a,
              int b) -&gt; <a href="classbn_1_1rect.html" class="m-doc">rect</a> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Returns a divided by b.</dd>
            <dt id="a41e8b374c691c8e7d65dc49267dd3842">
              <span class="m-doc-wrap-bumper">auto <a href="#a41e8b374c691c8e7d65dc49267dd3842" class="m-doc-self">operator==</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; a,
              const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; b) -&gt; bool <span class="m-label m-flat m-info">defaulted</span> <span class="m-label m-flat m-primary">constexpr</span></span>
            </dt>
            <dd>Default equal operator.</dd>
          </dl>
        </section>
        <section>
          <h2>Function documentation</h2>
          <section class="m-doc-details" id="ad782d984ec680a56ec58e8674bae7f91"><div>
            <h3>
              <span class="m-doc-wrap-bumper"> bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#ad782d984ec680a56ec58e8674bae7f91" class="m-doc-self">rect</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; position,
              const <a href="classbn_1_1size.html" class="m-doc">size</a>&amp; dimensions) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Constructor.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">position</td>
                  <td>Position of the center point of the rectangle.</td>
                </tr>
                <tr>
                  <td>dimensions</td>
                  <td>Size of the rectangle.</td>
                </tr>
              </tbody>
            </table>
          </div></section>
          <section class="m-doc-details" id="af0c7ad8b0005b079771eea22de759f12"><div>
            <h3>
              <span class="m-doc-wrap-bumper"> bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#af0c7ad8b0005b079771eea22de759f12" class="m-doc-self">rect</a>(</span><span class="m-doc-wrap">int x,
              int y,
              int width,
              int height) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Constructor.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">x</td>
                  <td>Horizontal position of the center point of the rectangle.</td>
                </tr>
                <tr>
                  <td>y</td>
                  <td>Vertical position of the center point of the rectangle.</td>
                </tr>
                <tr>
                  <td>width</td>
                  <td>Valid width of the rectangle (&gt;= 0).</td>
                </tr>
                <tr>
                  <td>height</td>
                  <td>Valid height of the rectangle (&gt;= 0).</td>
                </tr>
              </tbody>
            </table>
          </div></section>
          <section class="m-doc-details" id="a37bc38d06f075632ed4e468748f11308"><div>
            <h3>
              <span class="m-doc-wrap-bumper">void bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a37bc38d06f075632ed4e468748f11308" class="m-doc-self">set_position</a>(</span><span class="m-doc-wrap">int x,
              int y) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Sets the position of the center point of the rectangle.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">x</td>
                  <td>Horizontal position of the center point of the rectangle.</td>
                </tr>
                <tr>
                  <td>y</td>
                  <td>Vertical position of the center point of the rectangle.</td>
                </tr>
              </tbody>
            </table>
          </div></section>
          <section class="m-doc-details" id="a448fa647197b081035dc2bebe4f9661e"><div>
            <h3>
              <span class="m-doc-wrap-bumper">void bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a448fa647197b081035dc2bebe4f9661e" class="m-doc-self">set_dimensions</a>(</span><span class="m-doc-wrap">int width,
              int height) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Sets the size of the rectangle.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">width</td>
                  <td>Valid width of the rectangle (&gt;= 0).</td>
                </tr>
                <tr>
                  <td>height</td>
                  <td>Valid height of the rectangle (&gt;= 0).</td>
                </tr>
              </tbody>
            </table>
          </div></section>
          <section class="m-doc-details" id="af81766d35c3be21f02608fecb70976dc"><div>
            <h3>
              <span class="m-doc-wrap-bumper">void bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#af81766d35c3be21f02608fecb70976dc" class="m-doc-self">set_width</a>(</span><span class="m-doc-wrap">int width) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Sets the width of the rectangle.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">width</td>
                  <td>Valid width (&gt;= 0).</td>
                </tr>
              </tbody>
            </table>
          </div></section>
          <section class="m-doc-details" id="a8b21df7856dbbd3a3c38c0ad48fbd466"><div>
            <h3>
              <span class="m-doc-wrap-bumper">void bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a8b21df7856dbbd3a3c38c0ad48fbd466" class="m-doc-self">set_height</a>(</span><span class="m-doc-wrap">int height) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Sets the height of the rectangle.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">height</td>
                  <td>Valid height (&gt;= 0).</td>
                </tr>
              </tbody>
            </table>
          </div></section>
          <section class="m-doc-details" id="a5d4d32802fc63a93b8c85c01800a52d1"><div>
            <h3>
              <span class="m-doc-wrap-bumper">bool bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a5d4d32802fc63a93b8c85c01800a52d1" class="m-doc-self">contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; point) const <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Indicates if the given point is inside the rectangle or not.</p>
<p>If the point is on the edge of the rectangle, it returns <code>false</code>.</p>
          </div></section>
          <section class="m-doc-details" id="aac8db2d139d5bef452d014cd3c6321bb"><div>
            <h3>
              <span class="m-doc-wrap-bumper">bool bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#aac8db2d139d5bef452d014cd3c6321bb" class="m-doc-self">edge_contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1point.html" class="m-doc">point</a>&amp; point) const <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Indicates if the given point is inside the rectangle or not.</p>
<p>If the point is on the edge of the rectangle, it returns <code>true</code>.</p>
          </div></section>
          <section class="m-doc-details" id="a9ac43cbf65f781c62411657377a162bd"><div>
            <h3>
              <span class="m-doc-wrap-bumper">bool bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a9ac43cbf65f781c62411657377a162bd" class="m-doc-self">contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Indicates if the given rectangle is inside this one or not.</p>
<p>If the given rectangle is on the edge of this one, it returns <code>false</code>.</p>
          </div></section>
          <section class="m-doc-details" id="a489c30bd04e3d342ccb29463f84b5359"><div>
            <h3>
              <span class="m-doc-wrap-bumper">bool bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a489c30bd04e3d342ccb29463f84b5359" class="m-doc-self">edge_contains</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Indicates if the given rectangle is inside this one or not.</p>
<p>If the given rectangle is on the edge of this one, it returns <code>true</code>.</p>
          </div></section>
          <section class="m-doc-details" id="af9f9b9e6644f1736f30275433430791f"><div>
            <h3>
              <span class="m-doc-wrap-bumper">bool bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#af9f9b9e6644f1736f30275433430791f" class="m-doc-self">intersects</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Indicates if this rectangle intersects with the given one or not.</p>
<p>Two rectangles intersect if there is at least one point that is within both rectangles, excluding their edges.</p>
          </div></section>
          <section class="m-doc-details" id="a831de875831919a34bccec21f38ac239"><div>
            <h3>
              <span class="m-doc-wrap-bumper">bool bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a831de875831919a34bccec21f38ac239" class="m-doc-self">touches</a>(</span><span class="m-doc-wrap">const <a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; other) const <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Indicates if this rectangle touches the given one or not.</p>
<p>Two rectangles touch each other if there is at least one point that is within both rectangles, including their edges.</p>
          </div></section>
          <section class="m-doc-details" id="ab47aaef239cc4426f741b6f481df20eb"><div>
            <h3>
              <span class="m-doc-wrap-bumper"><a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#ab47aaef239cc4426f741b6f481df20eb" class="m-doc-self">operator*=</a>(</span><span class="m-doc-wrap">int value) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Multiplies both width and height of the rectangle by the given factor.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">value</td>
                  <td>Integer multiplication factor.</td>
                </tr>
              </tbody>
              <tfoot>
                <tr>
                  <th>Returns</th>
                  <td>Reference to this.</td>
                </tr>
              </tfoot>
            </table>
          </div></section>
          <section class="m-doc-details" id="a903c50e94d412752a496c9e88dbc8b3c"><div>
            <h3>
              <span class="m-doc-wrap-bumper"><a href="classbn_1_1rect.html" class="m-doc">rect</a>&amp; bn::<wbr />rect::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a903c50e94d412752a496c9e88dbc8b3c" class="m-doc-self">operator/=</a>(</span><span class="m-doc-wrap">int value) <span class="m-label m-primary">constexpr</span></span></span>
            </h3>
            <p>Divides both width and height of the rectangle by the given divisor.</p>
            <table class="m-table m-fullwidth m-flat">
              <thead>
                <tr><th colspan="2">Parameters</th></tr>
              </thead>
              <tbody>
                <tr>
                  <td style="width: 1%">value</td>
                  <td>Valid integer divisor (&gt; 0).</td>
                </tr>
              </tbody>
              <tfoot>
                <tr>
                  <th>Returns</th>
                  <td>Reference to this.</td>
                </tr>
              </tfoot>
            </table>
          </div></section>
        </section>
      </div>
    </div>
  </div>
</article></main>
<div class="m-doc-search" id="search">
  <a href="#!" onclick="return hideSearch()"></a>
  <div class="m-container">
    <div class="m-row">
      <div class="m-col-m-8 m-push-m-2">
        <div class="m-doc-search-header m-text m-small">
          <div><span class="m-label m-default">Tab</span> / <span class="m-label m-default">T</span> to search, <span class="m-label m-default">Esc</span> to close</div>
          <div id="search-symbolcount">&hellip;</div>
        </div>
        <div class="m-doc-search-content">
          <form>
            <input type="search" name="q" id="search-input" placeholder="Loading &hellip;" disabled="disabled" autofocus="autofocus" autocomplete="off" spellcheck="false" />
          </form>
          <noscript class="m-text m-danger m-text-center">Unlike everything else in the docs, the search functionality <em>requires</em> JavaScript.</noscript>
          <div id="search-help" class="m-text m-dim m-text-center">
            <p class="m-noindent">Search for symbols, directories, files, pages or
            modules. You can omit any prefix from the symbol or file path; adding a
            <code>:</code> or <code>/</code> suffix lists all members of given symbol or
            directory.</p>
            <p class="m-noindent">Use <span class="m-label m-dim">&darr;</span>
            / <span class="m-label m-dim">&uarr;</span> to navigate through the list,
            <span class="m-label m-dim">Enter</span> to go.
            <span class="m-label m-dim">Tab</span> autocompletes common prefix, you can
            copy a link to the result using <span class="m-label m-dim">⌘</span>
            <span class="m-label m-dim">L</span> while <span class="m-label m-dim">⌘</span>
            <span class="m-label m-dim">M</span> produces a Markdown link.</p>
          </div>
          <div id="search-notfound" class="m-text m-warning m-text-center">Sorry, nothing was found.</div>
          <ul id="search-results"></ul>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="search-v2.js"></script>
<script src="searchdata-v2.js" async="async"></script>
<footer><nav>
  <div class="m-container">
    <div class="m-row">
      <div class="m-col-l-10 m-push-l-1">
        <p>Butano Docs. Created with <a href="https://doxygen.org/">Doxygen</a> 1.14.0 and <a href="https://mcss.mosra.cz/">m.css</a>.</p>
      </div>
    </div>
  </div>
</nav></footer>
</body>
</html>
